<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<body>
  <button class="home">toHomePage</button>
  <br><br>
  <form action="http://127.0.0.1:3000/api/form" method="post">
    用户名： <input type="text" name="username"><br><br>
    密码：<input type="text" name="password"><br><br>
    <button type="submit">提交</button>
  </form>
  <script>
    $(function() {
      $('.home').on('click', () => {
        $.ajax({
          url: 'http://127.0.0.1:3000/api/home',
          type: 'GET',
          success: (res) => {
            console.log(res)
          }
        })
      })
    })
  </script>
</body>
</html>